package com.library.service.impl;


import java.util.List;

import com.library.common.utils.DateUtils;
import com.library.domain.AppActivityType;
import com.library.mapper.AppActivityTypeMapper;
import com.library.service.IAppActivityTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 活动类型Service业务层处理
 *
 * @author ruoyi
 * @date 2022-03-25
 */
@Service
public class AppActivityTypeServiceImpl implements IAppActivityTypeService {
    @Autowired
    private AppActivityTypeMapper appActivityTypeMapper;

    /**
     * 查询活动类型
     *
     * @param activityTypeId 活动类型主键
     * @return 活动类型
     */
    @Override
    public AppActivityType selectAppActivityTypeByActivityTypeId(Long activityTypeId) {
        return appActivityTypeMapper.selectAppActivityTypeByActivityTypeId(activityTypeId);
    }

    /**
     * 查询活动类型列表
     *
     * @param appActivityType 活动类型
     * @return 活动类型
     */
    @Override
    public List<AppActivityType> selectAppActivityTypeList(AppActivityType appActivityType) {
        return appActivityTypeMapper.selectAppActivityTypeList(appActivityType);
    }

    /**
     * 新增活动类型
     *
     * @param appActivityType 活动类型
     * @return 结果
     */
    @Override
    public int insertAppActivityType(AppActivityType appActivityType) {
        appActivityType.setCreateTime(DateUtils.getNowDate());
        return appActivityTypeMapper.insertAppActivityType(appActivityType);
    }

    /**
     * 修改活动类型
     *
     * @param appActivityType 活动类型
     * @return 结果
     */
    @Override
    public int updateAppActivityType(AppActivityType appActivityType) {
        appActivityType.setUpdateTime(DateUtils.getNowDate());
        return appActivityTypeMapper.updateAppActivityType(appActivityType);
    }

    /**
     * 批量删除活动类型
     *
     * @param activityTypeIds 需要删除的活动类型主键
     * @return 结果
     */
    @Override
    public int deleteAppActivityTypeByActivityTypeIds(Long[] activityTypeIds) {
        return appActivityTypeMapper.deleteAppActivityTypeByActivityTypeIds(activityTypeIds);
    }

    /**
     * 删除活动类型信息
     *
     * @param activityTypeId 活动类型主键
     * @return 结果
     */
    @Override
    public int deleteAppActivityTypeByActivityTypeId(Long activityTypeId) {
        return appActivityTypeMapper.deleteAppActivityTypeByActivityTypeId(activityTypeId);
    }
}
